﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Media;
using FileSysExp.Core;

namespace FileSysExp.Models
{
    public class DirItemViemModel : FileSystemItemBase
    {
        public override void GetChildren(bool includeFiles = false)
        {
            App.Current.Dispatcher.BeginInvoke(new Action(delegate
            {
                try
                {
                    List<IFileSysItem> list = FileSystemManager.Instance().GetDirectories(this);
                    if (includeFiles)
                    {
                        List<IFileSysItem> files = FileSystemManager.Instance().GetFiles(this);
                        list.AddRange(files);
                    }
                    Children = list;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "FileSysExp", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }));
        }
    }

    public class FileItemViewModel : FileSystemItemBase
    {

    }
}
